package com.itheima.tlias84;

import com.itheima.tlias84.entity.Teacher;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class Tlias84Application {

    public static void main(String[] args) {
        SpringApplication.run(Tlias84Application.class, args);
    }

    /**
     * 通过@bean创建的bean对象默认是创建该bean的方法名
     * 一般用于自动配置第三方对象的链接信息 例如阿里云的Oss对象
     */
    @Bean
    public Teacher createTeacherOne(){
        Teacher teacher = new Teacher();
        teacher.setName("张三");
        teacher.setAge(23);
        return teacher;
    }
    @Bean
    public Teacher createTeacherTwo(){
        Teacher teacher = new Teacher();
        teacher.setName("李四");
        teacher.setAge(24);
        return teacher;
    }
}
